package goinput

// Variable size byte buffer.
type Data struct {
	// Slice contents.
	Slice []byte
	// Number of bytes read.
	len int
}

// Return a fragment of the bytes read.
func (data Data) Bytes() []byte {
	return data.Slice[:data.len]
}

// Return the capacity of data.Slice.
func (data Data) Cap() int {
	return len(data.Slice)
}

// Return the number of bytes read.
func (data Data) Len() int {
	return data.len
}
